<style lang="scss" scoped>
.systemBox {
  padding: 10px;

  .texts {
    margin-bottom: 10px;
    padding: 10px;
    margin-top: 10px;
    width: 100%;
    border: 1px solid #efefef;

    span {
      font-size: 16px;
    }
  }
}
</style>
<template>
  <div class="systemBox">
    <van-nav-bar title="H币入账消息" left-arrow @click-left="$router.push('/information')" />
    <div class="texts" v-for="(item, index) in HcoinMsg" :key="index">
      <span>
        {{ item.content }}
        <span style="color: blue" @click="$router.push('/mywallet')">立即查看>></span>
      </span>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { request } from '../../axios/request'
import { ref } from 'vue'

// 获取userId, sessionId
   const userId= JSON.parse(localStorage.getItem('userId') || '0') 
   const sessionId=JSON.parse(localStorage.getItem('sessionId') || '0') 

// H币入账消息
const HcoinMsg: any = ref([])
const getHcoin = async () => {
  await request
    .get('/api/health/user/verify/v1/findHealthyCurrencyNoticeList', {
      params: {
        page: 1,
        count: 10
      },
      headers: {
        userId: userId.value as number,
        sessionId: sessionId.value as string
      }
    })
    .then((res) => {
      console.log(res.data)
      HcoinMsg.value = res.data.result
      console.log(HcoinMsg.value)
    })
}
getHcoin()
</script>
